home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hottest 5
/
Hottest 5 (1995)(PDSoft)[!].iso
/
pdsoft
/
panaroma
/
pan-28c.dms
/
pan-28c.adf
/
makema
/
mazes.doc
< prev
next >
Wrap
Text File
|
1988-02-13
|
2KB
|
35 lines
Muzz's Maze Makers
The 2 executables Maze1 and Maze2 are slight variations of a
Modula-2 program which generates mazes. They were written to try out
a demo copy of M2Amiga (by AMSoft) so some short cuts were needed to
keep the code size under the demo limit.
The basic algorithm is to grow a tree from a random point until all
squares in the maze area are connected. The maze is completed by
choosing 2 "leaf" squares as entry/exits. This ensures that there
is only one path through the maze.
All user communication is thru the IDCMP (Intuition Direct Communication
Message Port) and Pot gadget. The only Intuition messages that the
program responds to are "close-screen" and "screen-has-been-resized".
The Pot gadget is read when the screen is resized.
Because I don't open a console device it is a little hard to clear
screen or at least I haven't read enough to find a way yet. Fortunately
screen resizing clears the screen since I am using simple refresh.
Maze1 is the fastest. Maze2 allows the same sized maze to be repeatedly
drawn by clicking on the size gadget but not resizing the screen. If
you do that with Maze1 you will get a confused mess.
Feel free to use this software in any way you see fit.
I learnt a lot about Modula-2 and the Amiga by writing it.
By the way the M2Amiga compiler seems to be very good. I have looked
at the generated code and was pleased to see how compact it was.
Murray Mann (Muzz)
[72460,44]